string object

This method resizes a string.

void resize(uint new_length)

Parameters:
new_length
The new length of the string. A value of 0 means the string is reset completely.

Return value:
None.

Remarks:
If the new_length parameter is greater than the current length, the relevant number of null characters will be added to the string. If the value is less, the string is truncated from right to left.

Example:
// Declare a string and display its values.

void main()
{
string hello;
hello="Hello";
hello.resize(hello.length()-1);
for(uint counter=0; counter<hello.length(); counter++)
{
alert("Hello", "Hello now reads "+hello);
}
}